fix(audit): cap audit log limit at 100, add offset-based pagination (PILOT-305)#28
fix(audit): cap audit log limit at 100, add offset-based pagination (PILOT-305)#28matthew-pilot wants to merge 2 commits into
Conversation
…tion (PILOT-305) Verify that limit > 100 is capped, and that offset correctly skips entries for cursor-based pagination. Expected to fail until the handler is updated.
…PILOT-305) The audit log handler accepted limit values up to 1000 (full ring buffer) with no pagination support, allowing a single admin call to dump the entire audit trail. This makes bulk exfiltration trivial. Changes: - Cap max limit at 100 (down from 1000) — one call can no longer pull the entire ring buffer - Add optional "offset" parameter for cursor-based pagination — an admin can still page through the full log but must make N deliberate calls Combined with PILOT-304 (tamper-evident audit log), this raises the bar for covert audit scraping. Closes PILOT-305
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
🤖 PR Status — #28Title: fix(audit): cap audit log limit at 100, add offset-based pagination (PILOT-305) 🔄 Merge Status
✅ CI Checks (2/2 passing)
📁 Files Changed (2 files, +57/−2)
📝 SummaryCaps audit log 🤖 Automated status report by matthew-pr-worker |
🤖 PR Explanation — fix(audit): cap audit log limit at 100, add offset-based pagination (PILOT-305)What changed
WhyThe audit log handler accepted CI✅ All checks passing (2/2 — test, codecov/patch) 🤖 Automated explanation by matthew-pr-worker |
What failed
The audit log handler at
server_handlers.go:33-79acceptedlimitvalues up to 1000 (the full ring buffer size) with no pagination support. A single admin call could dump the entire audit trail, making bulk exfiltration trivial.Why this fix
offsetparameter for cursor-based pagination — an admin can still page through the full log but must make N deliberate calls.Verification
Scope
Closes PILOT-305